<template>
  <div class="footer_guide">
    <span
      href="javascript:;"
      class="guide_item"
      :class="{ on: '/' === $route.path }"
      @click="goTo('/')"
    >
      <span class="item_icon">
        <i class="iconfont icon-shouye1"></i>
      </span>
      <span class="footer_guiderList">首页</span>
    </span>
    <span
      href="javascript:;"
      class="guide_item"
      :class="{ on: '/homeland' === $route.path }"
      @click="goTo('/homeland')"
    >
      <span class="item_icon">
        <i class="iconfont icon-jiayuan"></i>
      </span>
      <span class="footer_guiderList">家园</span>
    </span>
    <span
      href="javascript:;"
      class="guide_item"
      :class="{ on: '/equipment' === $route.path }"
      @click="goTo('/equipment')"
    >
      <span class="item_icon">
        <i class="iconfont icon-shouhuan"></i>
      </span>
      <span class="footer_guiderList">设备</span>
    </span>
    <span
      href="javascript:;"
      class="guide_item"
      :class="{ on: '/profile' === $route.path }"
      @click="goTo('/profile')"
    >
      <span class="item_icon">
        <i class="iconfont icon-A"></i>
      </span>
      <span class="footer_guiderList">我的</span>
    </span>
  </div>
</template>
<script>
export default {
  methods: {
    goTo(path) {
      this.$router.replace(path);
    },
  },
};
</script>
<style>
.footer_guide {
  position: fixed;
  z-index: 100;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #fff;
  width: 100%;
  height: 50px;
  display: flex;
  border-top: 1px solid #e4e4e4;
}
.guide_item {
  display: flex;
  flex: 1;
  text-align: center;
  flex-direction: column;
  align-items: center;
  margin: 5px;
  color: #999999;
}
.on {
  color: #02a774;
}
.footer_guiderList {
  font-size: 13px;
  margin-top: 2px;
  margin-bottom: 2px;
}
.icon-shouye1,
.icon-jiayuan,
.icon-shouhuan,
.icon-A {
  font-size: 22px;
}
</style>
